type DesignSize = 1920 | 2580;

let currentDesignSize: DesignSize = 1920;

export function setRem(designSize: DesignSize = 1920) {
  console.log(designSize, "designSize");
  currentDesignSize = designSize;
  const baseSize = designSize / 100;
  console.log(baseSize);
  const scale = document.documentElement.clientWidth / designSize;
  console.log(baseSize * Math.min(scale, 2));
  document.documentElement.style.fontSize = baseSize + "px";
  console.log(baseSize * Math.min(scale, 2) + "px", 'baseSize * Math.min(scale, 2) + "px"');
}

export function getCurrentDesignSize(): DesignSize {
  return currentDesignSize;
}

export function initRem() {
  console.log(111);
  setRem();
  window.addEventListener("resize", () => setRem(currentDesignSize));
}
